<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

	<div id="filtriDivId">

		<p:panel id="panel" header="Filtri" toggleable="true" toggleSpeed="500" widgetVar="panel">
			<ui:remove> requiredMessage="numAccettazione: campo obbligatorio" required="true"</ui:remove>

			<div class="filtriField">
				<p:outputLabel for="username" value="Username:" />
				<p:inputText id="username"
					value="#{homePortaleBean.filtri.username}"
					label="username">
				</p:inputText>
			</div>
			<div class="filtriField">
				<p:outputLabel for="query" value="Query:" />
				<p:inputText id="query" value="#{homePortaleBean.filtri.query}"
					label="query">
				</p:inputText>
			</div>
			<div class="filtriField">
				<p:outputLabel for="laboratorio" value="Laboratorio:" />
				<p:inputText id="laboratorio" value="#{homePortaleBean.filtri.laboratorio}"
					label="laboratorio">
				</p:inputText>
			</div>
			<div class="filtriField">
				<p:outputLabel for="dataCreazioneDa"
					value="Data Creazione (da):" />
				<p:calendar pattern="dd/MM/yyyy" effect="drop"
					value="#{homePortaleBean.filtri.dataCreazioneDa}"
					id="dataCreazioneDa" />
			</div>
			<div class="filtriField">
				<p:outputLabel for="dataCreazioneA"
					value="Data Creazione (a):" />
				<p:calendar pattern="dd/MM/yyyy" effect="drop"
					value="#{homePortaleBean.filtri.dataCreazioneA}"
					id="dataCreazioneA" />
			</div>
			
			<div class="filtriField">
				<p:outputLabel for="dataUltimaModificaDa"
					value="Data Ultima Mod. (da):" />
				<p:calendar pattern="dd/MM/yyyy" effect="drop"
					value="#{homePortaleBean.filtri.dataUltimaModificaDa}"
					id="dataUltimaModificaDa" />
			</div>
			
			<div class="filtriField">
				<p:outputLabel for="dataUltimaModificaA"
					value="Data Ultima Mod. (a):" />
				<p:calendar pattern="dd/MM/yyyy" effect="drop"
					value="#{homePortaleBean.filtri.dataUltimaModificaA}"
					id="dataUltimaModificaA" />
			</div>
			
			<ui:remove>
			<div class="filtriField">
				<p:outputLabel for="rdpPresente" value="Rdp Presente:" />
				<p:selectBooleanCheckbox id="rdpPresente"
					value="#{homePortaleBean.filtri.rdpPresente}" />
				<p:tooltip for="rdpPresente"
					value="Se specificato, restituisce solo le accettazioni con RdP presente"
					showEffect="fade" hideEffect="fade" />
			</div>
			</ui:remove>
			
			<div align="right" style="clear: both; padding: 20px;">
				<p:commandButton value="Reset" update="panel" id="buttonReset"
					immediate="true" onclick="resetCampiFiltri();" />
				<p:commandButton value="Cerca" update="panelResult,growl"
					id="buttonCerca" action="#{homePortaleBean.searchResult}" />
			</div>
		</p:panel>
	</div>

	<script type="text/javascript">
		function resetCampiFiltri() {
			$(':input', '#filtriDivId')
					.not(':button, :submit, :reset, :hidden').val('')
					.removeAttr('checked').removeAttr('selected');
		}
	</script>
</ui:composition>